Convolutional neural networks layer by layer